/*
 * @Description:
 * @Version: 0.0.1
 * @Autor: zhj1214
 * @Date: 2021-11-24 15:10:50
 * @LastEditors: zhj1214
 * @LastEditTime: 2021-12-14 13:48:49
 */
import { createApp } from "vue";
/** ********** UI 组件 ******** */
import "vfonts/Lato.css"; // 通用字体
import {
  // create naive ui
  create,
  // component
  NButton,
  useNotification,
  useMessage,
} from "naive-ui";
/** ********** 模块依赖 ******** */
import App from "./App.vue";
import router from "./router/index";
import store from "./store/index";
import { sessionStorage, localStorage } from "./utils/localStorage";
import lazyPlugin from "./directive/imgLazy/index";
import "./mock";
import "./permission";

// 注册全局组件
const naive = create({
  components: [NButton, useNotification, useMessage],
});

const app = createApp(App);

// 获取原型
const prototype = app.config.globalProperties;
prototype.$session = sessionStorage; // session存储
prototype.$local = localStorage; // 本地存储
prototype.$store = store; // 本地存储
prototype.$router = router; // 本地存储

// 挂载
app.use(router).use(store).use(naive);
app.use(lazyPlugin, {
  // 添加一些配置参数
});
app.mount("#app");
